{{define "Title"}}{{.node.Name}}{{end}}
{{define "ContentWidth"}}8{{end}}
{{define "Breadcrumb"}}
<ul class="breadcrumb">
  <li><a href="/"><i class="glyphicon glyphicon-home"></i> 首页</a></li>
  <li class="active">{{.node.Name}}</a></li>
</ul>
{{end}}
{{define "Content"}}
<div class="content">
  <dl class="topics">
	{{range .topics}}
	{{$creater := .Creater $.db}}
	{{$node := .Node $.db}}
	<dd>
      <a href="/member/{{$creater.Username}}" class="pull-left" style="margin-right: 10px;"><img src="{{$creater.AvatarImgSrc 48}}" class="img-rounded" alt="{{$creater.Username}}"></a>
	  {{if .CommentCount}}
	  <a class="badge pull-right" href="/t/{{.Id_.Hex}}#.LatestReplyId.Hex">{{.CommentCount}}</a>
	  {{end}}
	  <a href="/t/{{.Id_.Hex}}" class="title">{{.Title}}</a>
	  <div class="space"></div>
	  <div class="info" style="margin-left:60px;">
		<a class="label label-info" href="/go/{{$node.Id}}">{{$node.Name}}</a> •
		<a href="/member/{{$creater.Username}}"><strong>{{$creater.Username}}</strong></a> •
		{{if .CommentCount}}
		{{$latestReplier := .LatestReplier $.db}}
		{{formattime .LatestRepliedAt}} • 最后回复来自 <a href="/member/{{$latestReplier.Username}}">{{$latestReplier.Username}}</a>
		{{else}}
		{{formattime .CreatedAt}}
		{{end}}
	  </div>
	  <div class="clear"></div>
	</dd>
	{{end}}
  </dl>
  <hr>
  {{.pagination.Html .page}}
</div>
{{end}}

{{define "LeftSide"}}{{end}}
{{define "RightSide"}}
<div class="col-md-4">
  <div class="well sidebar-nav">
	<h4>{{.node.Name}}</h4>
	<hr>
	<p>
	  {{.node.Description}}
	</p>
  </div>
  <a href="/topic/new" class="btn btn-success btn-lg btn-block" style="margin-bottom: 20px;"><i class="glyphicon glyphicon-edit"></i> 发表话题</a>
</div>
{{end}}
